package com.yuxi.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yuxi.Entity.Information;
import com.yuxi.Entity.UserInfo;
import com.yuxi.Entity.UserPosition;
import com.yuxi.Entity.UserStructure;
import com.yuxi.Entity.UserView;
import com.yuxi.Request.Page;
import com.yuxi.Request.UserQuery;
import com.yuxi.Response.Obj;

/**
 * 用户控制器
 * @version 0.1 2016-07-19 22:15:09
 * @author wyd
 * */
@Controller
public interface UserController {
	/**
	 * 获取验证码
	 * @param session
	 * @author wyd
	 * */
	@RequestMapping(value="getVerifyCode.do")
	public void getVerifyCode(HttpServletRequest request,HttpServletResponse response,HttpSession session);
	
	/**
	 *用户登录(1.工号+密码 查询实体类 2.添加一条登录记录)
	 *@param userAccount 工号
	 *@param pwd 密码
	 *@return 
	 *@author wyd 
	 * */
	@ResponseBody
	@RequestMapping(value="userLogin.do",produces={"application/json;charset=utf-8"})
	public String userLogin(String userAccount,String pwd,String verifyCode,HttpSession session,HttpServletRequest request,HttpServletResponse res);
	
		
	
	/**
	 * 添加用户 (1.添加用户到UserInfo 2.添加一条添加用户记录)
	 * @param userInfo	UserInfo 类 
	 * @return  
	 * @author wyd
	 * */
	@ResponseBody
	@RequestMapping(value="/LoginFilter/addUser.do",produces={"application/json;charset=utf-8"})
	public String addUser(UserInfo userInfo,int positionId,String positionName,int structureId,String structureName,int roleId,HttpSession session,HttpServletRequest request);
	/**
	 * 添加信息 (1.添加用户到Information 2.添加一条添加信息记录)
	 * @param userInfo	UserInfo 类 
	 * @return  
	 * @author wyd
	 * */
	@ResponseBody
	@RequestMapping(value="/LoginFilter/addInfo.do",produces={"application/json;charset=utf-8"})
	public String addInfo(Information information,HttpSession session);
	/**
	 * 根据部门获取用户列表
	 * @param StructId
	 * @author wyd
	 * */
	@ResponseBody
	@RequestMapping(value="/LoginFilter/getUserListByStruct.do",produces={"application/json;charset=utf-8"})
	public String getUserList(int  structId,HttpServletRequest request,HttpSession session);
	/**
	 * 获取用户创建的用户列表
	 * 
	 * */
	@ResponseBody
	@RequestMapping(value="/LoginFilter/getUserCreateUserList.do",produces={"application/json;charset=utf-8"})
	public String getUserCreateUserList(UserQuery userQuery,Page<UserView> p,HttpSession session);
	
	/**
	 * 获取待处理信息汇总
	 * @param session
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="/LoginFilter/getFlowCount.do",
					produces={"application/json;charset=utf-8"})
	public String getFlowCount(HttpSession session);
	
	/**
	 * 停用用户
	 * @param userId
	 * @param session
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="/LoginFilter/stopUserById.do",
					produces={"application/json;charset=utf-8"})
	public String stopUserById(Integer userId,HttpSession session);
	
	/**
	 * 启用用户
	 * @param userId
	 * @param session
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="/LoginFilter/enableUserById.do",
					produces={"application/json;charset=utf-8"})
	public String enableUserById(Integer userId,HttpSession session);
	
	/**
	 * userId
	 * @param userId
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="/LoginFilter/getUserById.do",produces={"application/json;charset=utf-8"})
	public String getUserById(Integer userId);
	
	
	/**
	 * @param userInfo
	 * @param roleId
	 * @param session
	 * @param request
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="/LoginFilter/userModify.do",
					produces={"application/json;charset=utf-8"})
	public String userModify(UserInfo userInfo,Integer roleId,UserPosition userPosition,HttpSession session,HttpServletRequest request);
	/**
	 * @param userInfo
	 * @param roleId
	 * @param session
	 * @param request
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="/LoginFilter/modifyUser.do",
					produces={"application/json;charset=utf-8"})
	public String modifyUser(UserInfo userInfo,Integer roleId,UserPosition userPosition,int structureId,String  structureName,HttpSession session,HttpServletRequest request);
	
}
